﻿using System;
using System.Collections.Generic;
using System.IO;

namespace Susam
{
    public enum FileTypeEnum { ePub, PDF };

    internal class Relator
    {
        public String role { get; set; }
        public String name { get; set; }

    }

    class FileData
    {
        public String filePath { get; set; }
        public String fileName { get; set; }
        public String fileType { get; set; }
        public DateTime timestamp { get; set; }
    }

    class Metadata
    {
        public int bookID { get; set; }
        public String title { get; set; }
        public List<Relator> authorList { get; set; }
        public List<String> publisherList { get; set; }
        public List<Relator> contributorList { get; set; }
        public List<String> subjectList { get; set; }
        public List<String> identifierList { get; set; }
        public List<String> languageList { get; set; }
        public Boolean isNewAddition { get; set; }
        public String description { get; set; }

        public FileData _file;

        public Metadata()
        {
            _file = new FileData();
        }

        public Metadata(String path)
        {
            _file = new FileData();

            this._file.filePath = path;
            this._file.fileName = Path.GetFileName(path);
            this._file.timestamp = File.GetLastWriteTime(path);
            this.authorList = new List<Relator>();
            this.publisherList = new List<String>();
            this.contributorList = new List<Relator>();
            this.subjectList = new List<String>();
            this.identifierList = new List<String>();
            this.languageList = new List<String>();
        }

        // Returns the unique identifier (file path) for an ebook file
        public override String ToString()
        {
            return this._file.filePath;
        }

    }
}
